package com.bindatax.core.task.event;

public enum EventType {
    TASK_INIT_BEFORE(1110,"任务初始化之前"),
    TASK_INIT_AFTER(1120,"任务初始化之后"),

    TASK_RUNNING_CREATE_CONN_BEFORE(1130,"任务执行中（构建连接池之前）"),
    TASK_RUNNING_CREATE_CONN_AFTER(1140,"任务执行中（构建连接池之后）"),

    TASK_RUNNING_SOURCE_QUERY_BEFORE(1210,"任务执行中（查询结果之前）"),
    TASK_RUNNING_SOURCE_QUERY_AFTER(1220,"任务执行中（查询结果之后）"),

    TASK_RUNNING_TARGET_META_BEFORE(1230,"任务执行中（获取目标表元数据之前）"),
    TASK_RUNNING_TARGET_META_AFTER(1240,"任务执行中（获取目标表元数据之后）"),

    TASK_RUNNING_MAPPING_COLUMN_BEFORE(1250,"任务执行中（映射查询结果集与目标表字段之前）"),
    TASK_RUNNING_MAPPING_COLUMN_AFTER(1260,"任务执行中（映射查询结果集与目标表字段之后）"),

    TASK_RUNNING_WRITE_DB_BEFORE(1310,"任务执行中（任务准备执行数据入库之前）"),
    TASK_RUNNING_QUERY_VALUE_DATA(1311,"任务执行中（从源库中查询获取的每一行的字段值）"),

    TASK_RUNNING_WRITE_BATCH_BEFORE(1320,"任务执行中（执行每个批次入库之前）"),

    TASK_RUNNING_WRITE_BATCH_AFTER_SUCCESS(1330,"任务执行中（执行每个批次入库成功之后）"),
    TASK_RUNNING_WRITE_BATCH_AFTER_FAIL(1340,"任务执行中（执行每个批次入库失败之后）"),

    TASK_RUNNING_SEGMENT_BEFORE(1350,"任务执行中（每个数据片开始入库数据之前）"),
    TASK_RUNNING_SEGMENT_NOTIFY_ERROR_STOP(1360,"任务执行中（每个数据片接收到任务组通知【停止数据入库】，退出循环获取公共数据池数据时）"),
    TASK_RUNNING_SEGMENT_AFTER_SUCCESS(1370,"任务执行中（每个数据片结束入库数据之后-成功）"),
    TASK_RUNNING_SEGMENT_AFTER_FAIL(1375,"任务执行中（每个数据片结束入库数据之后-失败）"),

    TASK_RUNNING_WRITE_BETWEEN_BATCH_FAIL_AND_ROW_BEFORE(1380,"任务执行中（在执行每个批次入库失败之后，转为按行入库之前）"),
    TASK_RUNNING_WRITE_ROW_AFTER_SUCCESS(1390,"任务执行中（按行入库成功之后）"),
    TASK_RUNNING_WRITE_ROW_AFTER_FAIL(1395,"任务执行中（按行入库失败之后）"),

    TASK_FINISH(1400,"任务完成"),
    TASK_FINISH_SUCCESS(1410,"任务完成（成功）"),
    TASK_FINISH_FAIL(1420,"任务完成（失败）"),
    TASK_DESTROYED(1999,"任务销毁时"),
    TASK_STATISTICS_CHANGE(2100,"当ExecuteStatistics统计数出现变化时"),
    ;
    private int typeOrder;
    private String description;
    EventType(int typeOrder,String description){
        this.typeOrder = typeOrder;
        this.description = description;
    }
    public String getDescription() {
        return description;
    }

    @Override
    public String toString() {
        return  "typeOrder=" + typeOrder + ", description='" + description  ;
    }
}
